#ifndef PREFERENCES_UI_INCLUDED
#define PREFERENCES_UI_INCLUDED

#include "boost\shared_ptr.hpp"
#include "PreferencesUiBase.h"
#include "resource.h"
#include <lib\controls_lib\Label.h>
#include <lib\controls_lib\Separator.h>
#include "DlgUV.h"

struct KUvArea
{
	std::wstring wstrPlane;			// k or uv
	std::wstring wstrLeft;			// x ordinates
	std::wstring wstrTop;			// y ordinates
	std::wstring wstrWidth;			// x length
	std::wstring wstrHeight;		// y length
	std::wstring wstrOffsetX;		// for uv only
	std::wstring wstrOffsetY;		// for uv only
	std::wstring wstrPixelColor;	// for k only
	std::wstring wstrType;			// text or graphics, additional pixelcolour for k
	std::wstring wstrSide;			// front or back
};

struct _PrintingPreferences
{
	std::wstring wstrOrientation;		// layout dialog 
	bool bMagstripe;					// layout dialog
	bool bSmartChip;					// layout dialog
	bool bBothType;						// layout dialog	
	bool bRotate;						// layout dialog
	bool bSwap;							// layout dialog
	std::wstring wstrFlipAxis;			// layout dialog
	std::wstring wstrColorFront;		// layout dialog
	std::wstring wstrColorBack;			// layout dialog
	bool bPrintBackSide;				// layout dialog
	bool bCardOutEnable;				// xid dialog
	bool bXIDSaveMaterial;				// xid dialog
	std::wstring wstrSideUp;			// xid dialog	
	std::wstring wstrEncMethod;			// layout dialog
	std::wstring wstrKDitherFactor;		// k dialog	
	bool bKExtractBlkTxtFront;			// k dialog
	bool bKExtractBlkTxtBack;			// k dialog
	bool bKAreaFront;					// k dialog		
	bool bKAreaBack;					// k dialog		
	bool bKSecureEraseFront;			// k dialog		
	bool bKSecureEraseBack;				// k dialog		
	bool bUVPrintYMCUVOnSameRetransfer;	// uv dialog	
	bool bUVAreaFront;					// uv dialog	
	bool bUVAreaBack;					// uv dialog	
	bool bUVImageFront;					// uv dialog	
	bool bUVImageBack;					// uv dialog	
	bool bUVRetransPatchFront;			// uv dialog	// not using atm
	bool bUVRetransPatchBack;			// uv dialog	// not using atm
	bool bUVFrom2ndPageFront;			// uv dialog	
	bool bUVFrom2ndPageBack;			// uv dialog	
	bool bUVSecureAreaPos1Front;		// uv dialog	
	bool bUVSecureAreaPos2Front;		// uv dialog	
	bool bUVSecureAreaPos1Back;			// uv dialog	
	bool bUVSecureAreaPos2Back;			// uv dialog	
	std::wstring wstrUVBitmapFront;		// uv dialog
	std::wstring wstrUVBitmapBack;		// uv dialog
	std::vector<KUvArea> vecArea;		// uv dialog
};

class PreferencesUiImpl;

class PreferencesUi : public PreferencesUiBase
{
private:
	boost::shared_ptr<PreferencesUiImpl> pImpl;

	CDialog * UVDlg;

	DlgUV * UVDialog;

	_PrintingPreferences *GpUV_Preferences;

public:
	PreferencesUi();

	CLabel UVCardOptions;
	CLabel UVSideOptions;
	CLabel UVFront;
	CLabel UVBack;

	CSeparator UVSeparator[ 7 ];

	virtual const char *getVersion();

	//virtual HWND createDialog( IN const char *pszSheet,
	//							HWND ParentWindow );

	//virtual bool setPreferences( IN const char *pszSheet,
	//							 IN const char *pszPreferences );

	virtual bool getPreferences( IN const char *pszSheet,
								 INOUT std::string &strPreferences );

	virtual bool onActivate( IN const char *pszSheet );

	virtual bool onHide( IN const char *pszSheet );

	virtual CDialog * createDialog( IN const wchar_t *pszSheet, CWnd * ParentWindow );

	virtual bool setPreferences( IN const wchar_t *pszSheet);

	virtual bool loadImages( IN const wchar_t *pszSheet );

	virtual bool updatePreferences( IN const wchar_t *pszSheet, IN const wchar_t *type, IN const wchar_t *value );

	virtual bool detectPreferencesChange( IN const wchar_t *pszSheet, IN const wchar_t *type );

	virtual bool setData( IN _PrintingPreferences *PrintingPreferences );
};

#endif // PREFERENCES_UI_INCLUDED